UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5ScPtXSF+5HYJWCJEfYyehNmaCSgC3fo96TzIlErU20='
WHERE
key_id = '0693ccd99fa56c11f809b07aa0d7895166a686c29a9d7e79fc1c0ea22ac90b17'
AND (
token = '5ScPtXSF+5HYJWCJEfYyehNmaCSgC3fo96TzIlErU20='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)