UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R5tDb9vd64GHRCoyBWGT3L1l7wP0MeJ0EhF4kJq6EXw='
WHERE
key_id = 'ef0ac959d838ed849a9a2e8f8cb025fd4534511acfec8ade1992ced3e1971034'
AND (
token = 'R5tDb9vd64GHRCoyBWGT3L1l7wP0MeJ0EhF4kJq6EXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)