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