UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tR1u8K42kB2rlvLJYzkWLX2w/cWy0yq/oAAXrAIP40E='
WHERE
key_id = '0cb7df6a0e37b1bdd569430c9ff55bfe3a295ac4b1ac14a1b34664fadd2d77b9'
AND (
token = 'tR1u8K42kB2rlvLJYzkWLX2w/cWy0yq/oAAXrAIP40E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)