UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WMUfEw6IrvjjZ9YmfvQb0Pk7xyFUn2OgGif7aPLnmIw='
WHERE
key_id = '004fa78f540f0ca418297097507ad8cc39c8ddd4109ade0b73c1d8ea236b3d40'
AND (
token = 'WMUfEw6IrvjjZ9YmfvQb0Pk7xyFUn2OgGif7aPLnmIw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)