UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4zEzza3jPoDaEDj7zZjUq9evCEDfrallrkjgM7uJSuQ='
WHERE
key_id = '07aae6a70bc3289f471b8b1facb5a0452a04722d30bf950c74e45246e2f72cc8'
AND (
token = '4zEzza3jPoDaEDj7zZjUq9evCEDfrallrkjgM7uJSuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)