UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yvOv/ox95MUpB2Oq/lKe2VJV+itaybct0hlSIUfjD8g='
WHERE
key_id = 'cf1870360cd5a98c5edfafb4104a52e0c02992a2e2789c9c4baec3274730371b'
AND (
token = 'yvOv/ox95MUpB2Oq/lKe2VJV+itaybct0hlSIUfjD8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)