UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1pJtkIpbuyS4YLELFEo9LEQSy0fV/Dh6hk3cqyj6nrA='
WHERE
key_id = 'ad5337009dbbc683dd27a4e318f4183bd1b0feeabdd6c966a6cf21c9f807212a'
AND (
token = '1pJtkIpbuyS4YLELFEo9LEQSy0fV/Dh6hk3cqyj6nrA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)