UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ah9uPuKo8/deQMPlfTnACXXbThQMWrmNwZTrPd169M='
WHERE
key_id = '907dd472c451f3875fbfaaa8aacd668126608ac57999f20c71ded47cb2bf8732'
AND (
token = '4ah9uPuKo8/deQMPlfTnACXXbThQMWrmNwZTrPd169M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)