UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i61fgcaqjAgqaWzXj3do2TZVKN53XNBqCu8ebDYa1RA='
WHERE
key_id = 'eacb8b5fbc4f2e59162707a003f62d6f62549658b7a9a12dde9bd29adf258710'
AND (
token = 'i61fgcaqjAgqaWzXj3do2TZVKN53XNBqCu8ebDYa1RA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)