UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XUFRzyDGjG2WIFDKtutglZOnoH7+VAqv5xvYieHmv4E=' 
WHERE 
  key_id = '094d29755e93fe02361f4ef5b89a47e175c9f7f0918d61cfb09ee6074a519ffc' 
  AND (
    token = 'XUFRzyDGjG2WIFDKtutglZOnoH7+VAqv5xvYieHmv4E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041