UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iNriC5c3xpQ6Z5fUrSDuJT7e4YEhg4/mLslgw8lecc0=' 
WHERE 
  key_id = 'd6d0a861adec759e87251fa55aa4fcdb5922ed4a0a4be6a8e93c56a1bae43f68' 
  AND (
    token = 'iNriC5c3xpQ6Z5fUrSDuJT7e4YEhg4/mLslgw8lecc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030