UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fNyf6Uun+Stgr6mgWuJ9aJuRepAzSPcmFO+lAo0TO/o='
WHERE
key_id = '4796b41e9e18a17f2de1452b53b331a68500bcc06054d5a4992a9691a54a296c'
AND (
token = 'fNyf6Uun+Stgr6mgWuJ9aJuRepAzSPcmFO+lAo0TO/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)