UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CESf7g0QEmsZ8fdJJfol5gNI/z9Z/nl1FznYcRjcZ0I=' 
WHERE 
  key_id = 'c8b10d3be4510a570fe6bac1c0ae66e62b437a2e69c1a6f7b95e9e5da36ca236' 
  AND (
    token = 'CESf7g0QEmsZ8fdJJfol5gNI/z9Z/nl1FznYcRjcZ0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029