UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VhrXmCYEw0PA++DvZtGunCQhLOxw6XxNTgeoMuQzzis='
WHERE
key_id = 'fe98ced5e291d5229f9ed1b5b488c973ab9d51b897ee3fd22ac02440ab5399b5'
AND (
token = 'VhrXmCYEw0PA++DvZtGunCQhLOxw6XxNTgeoMuQzzis='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)