UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZgGAz/INpH6HFtN+RIY4SZe+8lK+GdxEHSuLW03zhZg='
WHERE
key_id = '7276a7cd43240af9cec18279b2cd532febb6aedc6b798db4c0342ee7b02f3962'
AND (
token = 'ZgGAz/INpH6HFtN+RIY4SZe+8lK+GdxEHSuLW03zhZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)