UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xCcjXjPIt2sBa1J5B8mi7lRPu9Tf+kWNu/c69Ty7dJM='
WHERE
key_id = 'd29de369f05923deb8bd5626ce2dc73534ae8a2a69a8b0f920b4ff92b55bed4d'
AND (
token = 'xCcjXjPIt2sBa1J5B8mi7lRPu9Tf+kWNu/c69Ty7dJM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)