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