UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TOQxnNu2gbCLUKmJ0IhUHy3hA17gzBf38cCo3dciSyw='
WHERE
key_id = '08e5f298da4d831c11ddccf0eef0cfa2f4538d63e43c302cffefeb817c112956'
AND (
token = 'TOQxnNu2gbCLUKmJ0IhUHy3hA17gzBf38cCo3dciSyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)