UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jyxPRX0Dd0/qIMvTSDxSDBqNsHSyusZnQHoVKi1ikFs='
WHERE
key_id = 'bcf01722bed6017617be8a2a65a87495f29f31aebfcdc895d58ac401d85a4b15'
AND (
token = 'jyxPRX0Dd0/qIMvTSDxSDBqNsHSyusZnQHoVKi1ikFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)