UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nNjgBeEy+KILNLMpevyhoEQRHG6vl6oWASYYy9xkyRI='
WHERE
key_id = '85ac731b7a91a34d7d84115b1e1fbe6d411b13a0e143ae2264ab38dc0ec93d6e'
AND (
token = 'nNjgBeEy+KILNLMpevyhoEQRHG6vl6oWASYYy9xkyRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)