UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3X19ytCY6lFD4RYGGI06EcT1WbFJ/S9hTV0BrukvUCs='
WHERE
key_id = 'b0907a66fc49ff3b6c8c59efdbcae0b304043d014b1f28a6b8bcb976fa6c3cf6'
AND (
token = '3X19ytCY6lFD4RYGGI06EcT1WbFJ/S9hTV0BrukvUCs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)