UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6+2FAiJtdXejjWbgW9mijvhjyPLHNWRw9OYF9Av/7C0='
WHERE
key_id = 'b058b37b71dd82dc95fa410c541611ef1e447b5f0332b628d2b0874a11f53138'
AND (
token = '6+2FAiJtdXejjWbgW9mijvhjyPLHNWRw9OYF9Av/7C0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)