UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OJI2AgDdUw2/MzQLnd8RuR4gpv+JXIVvlli/jXXk8U8='
WHERE
key_id = '02cd0fc34db9333a9c9c011c667526e7a9eac868be21cf968a1257554b15b18e'
AND (
token = 'OJI2AgDdUw2/MzQLnd8RuR4gpv+JXIVvlli/jXXk8U8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)