UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q76E6mTtO9kwkkTXD900rOw92CDfBqV5W26bEZMMnbI=' 
WHERE 
  key_id = '9e9e9538d656e907f71feb0ad0579c7d4bc0867b0ff9a7f07d523a72d5c9c195' 
  AND (
    token = 'q76E6mTtO9kwkkTXD900rOw92CDfBqV5W26bEZMMnbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040