UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CT4j/dUQXVuC3vu8mX0ezXvc/QaHksIPvMDTSXrydmI='
WHERE
key_id = '93722c25a089adcce2c1b539b61d4a635d060b75af8c0ffa17b53d22805a7711'
AND (
token = 'CT4j/dUQXVuC3vu8mX0ezXvc/QaHksIPvMDTSXrydmI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)