UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xcdI51vxVVfovdD04SDhZ5IAebRD6bnuHMYZyqo1M1I='
WHERE
key_id = '71f3b661a6f6b51587450b92dd621d1d54bb1f00ed64cb6142b44d9f6bfcff96'
AND (
token = 'xcdI51vxVVfovdD04SDhZ5IAebRD6bnuHMYZyqo1M1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)