UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7quDGrdIYfSFpde5Hnu0Q1G+us800QxA7ErEwX7FwV0='
WHERE
key_id = '71f2becf76388a876ef5a790f88b92446dc9240741c25c33cd0781e7df6f6c1c'
AND (
token = '7quDGrdIYfSFpde5Hnu0Q1G+us800QxA7ErEwX7FwV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)