UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PZKStrBx7OQOUQD9Z9f44sGZby7tF2niwE+KJg432h0='
WHERE
key_id = 'ca6ac259a3202de90dbfba8d22f02d1e7542daf1cff6435cec6fdd96b020ef72'
AND (
token = 'PZKStrBx7OQOUQD9Z9f44sGZby7tF2niwE+KJg432h0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)