UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8Dqsy5yQkBj2CNdURsqF1E9gKzLBgYV7p4EE14njMpY='
WHERE
key_id = 'df32e2079eab0ab4f1bada6394f467394462b3d66f12a6792bdd23bc18311b31'
AND (
token = '8Dqsy5yQkBj2CNdURsqF1E9gKzLBgYV7p4EE14njMpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)