UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1C0YgpOZq3WH+o9WsunUQC0PYJKc80yysB1epJlGP9Q='
WHERE
key_id = 'b887a79dcadab0a4aaa606316f56d3a691d776a8dbfdbf4005ce3af4b645a380'
AND (
token = '1C0YgpOZq3WH+o9WsunUQC0PYJKc80yysB1epJlGP9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)