UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QvCNZVNUXvOTXiWJMNadbOhPTbgO5IYawNiyeG96QfI=' 
WHERE 
  key_id = 'c3f04f8c1110e5b5c1ca5e181b98cf7e354ee498b4441840387da872961e2bb8' 
  AND (
    token = 'QvCNZVNUXvOTXiWJMNadbOhPTbgO5IYawNiyeG96QfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034