UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zrRgv2zejxNeSOrn9A+pWYKskkEBP6f/YaD79pj1XhU='
WHERE
key_id = 'ead9ea4ce035c9bccec568c740f439081bf9050c47be3a35c72d2b0ffe6c4e14'
AND (
token = 'zrRgv2zejxNeSOrn9A+pWYKskkEBP6f/YaD79pj1XhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)